package org.shop.oauth.demo.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.shop.oauth.demo.entity.Authority;

import java.util.List;

@Mapper
public interface AuthorityDao {
    @Select( "SELECT A.id,A.authority FROM authority A LEFT JOIN credentials_authorities B ON A.id=B.authorities_id WHERE B.credentials_id=${userId}" )
    List<Authority> getAuthroitiesByCredential(@Param("userId") Long userId);

}
